<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../../jquery-3.2.1.js"></script>
    <script>
        let promise = new Promise((resolve, reject) => {
            if (true) {
                resolve('成功状态')
            } else {
                reject('失败状态')
            }
        })
        console.log(promise);

        promise.then((data) => {
            console.log(data);

        })
        promise.catch(err => {
            console.log(err);

        })


        let a1 = new Promise.reject(xx);
        a1.catch(err);
        console.log(err);

    </script>
</body>

</html>